LL power(LL x, int p){ LL cnt = 1; while (p) { if (p & 1) cnt = cnt * x % MOD; x = x * x % MOD; p >>= 1; } return cnt; }
int N, M; bitset<MAXN> bit[MAXN];
intGuass(){ int row, col; for (row = 1, col = 1; row <= N && col <= M; row ++, col ++) { for (int i = row + 1; i <= N; i ++) if (bit[i][col]) swap (bit[row], bit[i]); if (! bit[row][col]) { row --; continue; } for (int i = row + 1; i <= N; i ++) if (bit[i][col]) bit[i] ^= bit[row]; } row --; return N - row; }
intgetnum(){ int num = 0; char ch = getchar (); while (! isdigit (ch)) ch = getchar (); while (isdigit (ch)) num = (num << 3) + (num << 1) + ch - '0', ch = getchar (); return num; }
N = getnum (), M = getnum (); for (int i = 1; i <= N; i ++) for (int j = 1; j <= M; j ++) { int p = getnum (); bit[i][j] = p; } int zero = Guass (); LL ans = ((power (2ll, zero) - 1 + MOD) % MOD * ((power (2ll, M) - 1 + MOD) % MOD) % MOD + (power (2ll, N) - power (2ll, zero) + MOD) % MOD * ((power (2ll, M - 1) - 1 + MOD) % MOD) % MOD) % MOD; cout << ans << endl;